package com.example.spring.mapper;

import com.example.spring.entity.Warehouse;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WarehouseMapper {
    @Select("SELECT * FROM warehouse")
    List<Warehouse> findAll();

    @Insert("INSERT INTO warehouse(name, address, info, pic, totalNo, currentNo, slotNo) VALUES(#{name}," +
            "#{address}, #{info}, #{pic}, #{totalNo}, #{currentNo}, #{slotNo})")
    int insert_data(Warehouse warehouse);

    int update(Warehouse warehouse);

    @Delete("DELETE FROM warehouse WHERE whid = #{whid}")
    Integer deleteById(@Param("whid") Integer whid);

}
